package com.eastfair.home.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDate;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.database.mybatis.typehandler.M9EncryptHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.home.enumeration.WorkOvertimeAuditAuditStatusEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 加班审核
 * </p>
 *
 * @author dqq
 * @since 2023-03-07
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value="hc_work_overtime_audit",autoResultMap = true)
@ApiModel(value = "WorkOvertimeAudit", description = "加班审核")
@AllArgsConstructor
public class WorkOvertimeAudit extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用（确认状态）：1是 已确认；0否 未确认
     */
    @ApiModelProperty(value = "是否启用（确认状态）：1是 已确认；0否 未确认")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用（确认状态）：1是 已确认；0否 未确认")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 加班单号
     */
    @ApiModelProperty(value = "加班单号")
    @Size(max = 64, message = "加班单号长度不能超过64")
    @TableField(value = "work_overtime_number", condition = LIKE)
    @Excel(name = "加班单号")
    private String workOvertimeNumber;

    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @TableField(value = "exhibition_manage_id")
    @Excel(name = "展会ID")
    private Long exhibitionManageId;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @Size(max = 200, message = "展会名称长度不能超过200")
    @TableField(value = "exhibition_manage_name", condition = LIKE)
    @Excel(name = "展会名称")
    private String exhibitionManageName;

    /**
     * 公司ID
     */
    @ApiModelProperty(value = "公司ID")
    @TableField(value = "company_id")
    @Excel(name = "公司ID")
    private Long companyId;

    /**
     * 公司编码
     */
    @ApiModelProperty(value = "公司编码")
    @Size(max = 64, message = "公司编码长度不能超过64")
    @TableField(value = "company_code", condition = LIKE)
    @Excel(name = "公司编码")
    private String companyCode;

    /**
     * 公司名称
     */
    @ApiModelProperty(value = "公司名称")
    @Size(max = 200, message = "公司名称长度不能超过200")
    @TableField(value = "company_name", condition = LIKE)
    @Excel(name = "公司名称")
    private String companyName;

    /**
     * 公司类型
     */
    @ApiModelProperty(value = "公司类型")
    @Size(max = 64, message = "公司类型长度不能超过64")
    @TableField(value = "company_type", condition = LIKE)
    @Excel(name = "公司类型")
    private String companyType;

    /**
     * 联系人
     */
    @ApiModelProperty(value = "联系人")
    @Size(max = 100, message = "联系人长度不能超过100")
    @TableField(value = "contact", condition = LIKE)
    @Excel(name = "联系人")
    private String contact;

    /**
     * 联系方式
     */
    @ApiModelProperty(value = "联系方式")
    @Size(max = 100, message = "联系方式长度不能超过100")
    @TableField(value = "phone", condition = LIKE,typeHandler = M9EncryptHandler.class)
    @Excel(name = "联系方式")
    private String phone;

    /**
     * 展厅编码
     */
    @ApiModelProperty(value = "展厅编码")
    @Size(max = 64, message = "展厅编码长度不能超过64")
    @TableField(value = "space_code", condition = LIKE)
    @Excel(name = "展厅编码")
    private String spaceCode;

    /**
     * 展厅号
     */
    @ApiModelProperty(value = "展厅号")
    @Size(max = 100, message = "展厅号长度不能超过100")
    @TableField(value = "space_name", condition = LIKE)
    @Excel(name = "展厅号")
    private String spaceName;

    /**
     * 展位号
     */
    @ApiModelProperty(value = "展位号")
    @Size(max = 100, message = "展位号长度不能超过100")
    @TableField(value = "site_name", condition = LIKE)
    @Excel(name = "展位号")
    private String siteName;

    /**
     * 展位面积
     */
    @ApiModelProperty(value = "展位面积")
    @TableField(value = "site_area")
    @Excel(name = "展位面积")
    private BigDecimal siteArea;

    /**
     * 备注信息
     */
    @ApiModelProperty(value = "备注信息")
    @Size(max = 500, message = "备注信息长度不能超过500")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注信息")
    private String remark;

    /**
     * 申请时间
     */
    @ApiModelProperty(value = "申请时间")
    @TableField(value = "report_time")
    @Excel(name = "申请时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime reportTime;

    /**
     * 加班日期
     */
    @ApiModelProperty(value = "加班日期")
    @TableField(value = "overtime_date")
    @Excel(name = "加班日期", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDate overtimeDate;

    /**
     * 加班开始时间
     */
    @ApiModelProperty(value = "加班开始时间")
    @Size(max = 50, message = "加班开始时间长度不能超过50")
    @TableField(value = "overtime_start", condition = LIKE)
    @Excel(name = "加班开始时间")
    private String overtimeStart;

    /**
     * 加班结束时间
     */
    @ApiModelProperty(value = "加班结束时间")
    @Size(max = 50, message = "加班结束时间长度不能超过50")
    @TableField(value = "overtime_end", condition = LIKE)
    @Excel(name = "加班结束时间")
    private String overtimeEnd;

    /**
     * 申请加班时长
     */
    @ApiModelProperty(value = "申请加班时长")
    @TableField(value = "report_overtime_period")
    @Excel(name = "申请加班时长")
    private Double reportOvertimePeriod;

    /**
     * 加班类型
     */
    @ApiModelProperty(value = "加班类型")
    @Size(max = 64, message = "加班类型长度不能超过64")
    @TableField(value = "work_overtime_type", condition = LIKE)
    @Excel(name = "加班类型")
    private String workOvertimeType;

    /**
     * 主场ID
     */
    @ApiModelProperty(value = "主场ID")
    @TableField(value = "home_court_id")
    @Excel(name = "主场ID")
    private Long homeCourtId;

    /**
     * 主场名称
     */
    @ApiModelProperty(value = "主场名称")
    @Size(max = 100, message = "主场名称长度不能超过100")
    @TableField(value = "home_count_name", condition = LIKE)
    @Excel(name = "主场名称")
    private String homeCountName;

    /**
     * 审核状态 #{SUBMIT:待审核;APPROVED:审核通过;NOT_APPROVED:审核未通过}
     */
    @ApiModelProperty(value = "审核状态 #{SUBMIT:待审核;APPROVED:审核通过;NOT_APPROVED:审核未通过}")
    @TableField(value = "audit_status")
    @Excel(name = "审核状态 #{SUBMIT:待审核;APPROVED:审核通过;NOT_APPROVED:审核未通过}", replace = {"待审核_SUBMIT", "审核通过_APPROVED", "审核未通过_NOT_APPROVED",  "_null"})
    private WorkOvertimeAuditAuditStatusEnum auditStatus;

    /**
     * 审核意见
     */
    @ApiModelProperty(value = "审核意见")
    @Size(max = 200, message = "审核意见长度不能超过200")
    @TableField(value = "audit_opinion", condition = LIKE)
    @Excel(name = "审核意见")
    private String auditOpinion;

    /**
     * 审核时间
     */
    @ApiModelProperty(value = "审核时间")
    @TableField(value = "audit_time")
    @Excel(name = "审核时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime auditTime;

    /**
     * 审核人ID
     */
    @ApiModelProperty(value = "审核人ID")
    @TableField(value = "audit_user_id")
    @Excel(name = "审核人ID")
    private Long auditUserId;

    /**
     * 审核人姓名
     */
    @ApiModelProperty(value = "审核人姓名")
    @Size(max = 64, message = "审核人姓名长度不能超过64")
    @TableField(value = "audit_user_name", condition = LIKE)
    @Excel(name = "审核人姓名")
    private String auditUserName;


    @Builder
    public WorkOvertimeAudit(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    String workOvertimeNumber, Long exhibitionManageId, String exhibitionManageName, Long companyId, String companyCode, String companyName, 
                    String companyType, String contact, String phone, String spaceCode, String spaceName, String siteName, 
                    BigDecimal siteArea, String remark, LocalDateTime reportTime, LocalDate overtimeDate, String overtimeStart, String overtimeEnd, 
                    Double reportOvertimePeriod, String workOvertimeType, Long homeCourtId, String homeCountName, WorkOvertimeAuditAuditStatusEnum auditStatus, String auditOpinion, 
                    LocalDateTime auditTime, Long auditUserId, String auditUserName) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.workOvertimeNumber = workOvertimeNumber;
        this.exhibitionManageId = exhibitionManageId;
        this.exhibitionManageName = exhibitionManageName;
        this.companyId = companyId;
        this.companyCode = companyCode;
        this.companyName = companyName;
        this.companyType = companyType;
        this.contact = contact;
        this.phone = phone;
        this.spaceCode = spaceCode;
        this.spaceName = spaceName;
        this.siteName = siteName;
        this.siteArea = siteArea;
        this.remark = remark;
        this.reportTime = reportTime;
        this.overtimeDate = overtimeDate;
        this.overtimeStart = overtimeStart;
        this.overtimeEnd = overtimeEnd;
        this.reportOvertimePeriod = reportOvertimePeriod;
        this.workOvertimeType = workOvertimeType;
        this.homeCourtId = homeCourtId;
        this.homeCountName = homeCountName;
        this.auditStatus = auditStatus;
        this.auditOpinion = auditOpinion;
        this.auditTime = auditTime;
        this.auditUserId = auditUserId;
        this.auditUserName = auditUserName;
    }

}
